package com.inspectortime.repository;

import java.io.Serializable;
import java.util.List;

import com.inspectortime.domain.Employee;
import com.inspectortime.domain.Inspection;
import com.inspectortime.domain.Inspector;
import com.inspectortime.domain.InspectorCompany;
import com.inspectortime.domain.OptionalService;
import com.inspectortime.domain.RealEstateAgent;
import com.inspectortime.domain.Scheduler;
import com.inspectortime.domain.User;
import com.inspectortime.domain.ZipCodeGeoData;
import com.inspectortime.domain.billing.Invoice;
import com.inspectortime.domain.billing.InvoiceLineItem;
import com.inspectortime.domain.billing.Payment;
import com.inspectortime.domain.billing.PaymentLineItem;
import com.inspectortime.domain.billing.PaymentSourceType;
import com.inspectortime.domain.pricing.BaseFeeWithAdjustersCalculator;
import com.inspectortime.domain.pricing.FeeCalculator;

public interface Repository {

	void deleteInspection(Inspection inspection);

	void deleteAllInspectionsForInspector(Inspector inspector);

	void deleteAllInspectionsForInspectorCompany(InspectorCompany company);

	void deleteEmployee(Employee employee);

	void deleteInspector(Inspector inspector);

	void deleteInspectorCompany(InspectorCompany company);

	void deleteFeeCalculator(InspectorCompany company, FeeCalculator calc);

	void deleteScheduler(Scheduler scheduler);

	void deleteRealEstateAgent(RealEstateAgent realEstateAgent);

	List<RealEstateAgent> findAllRealEstateAgents();

	List<InspectorCompany> findAllInspectorCompanies();

	List<User> findAllUsers();

	Inspection findInspectionByCode(String inspectionCode);

	List<Inspection> findInspectionsByReferringAgent(
			RealEstateAgent agent);

		InspectorCompany findInspectorCompanyByName(String name);

	InspectorCompany findInspectorCompanyByShortName(String shortName);

	List<InspectorCompany> findInspectorCompaniesByZipCode(List<String> zipCodes);
	
	List<Inspection> findQuickBookedInspections();

	RealEstateAgent findRealEstateAgentByCode(String code);

	User findUserByEmail(String email);

	User findUserByEmailOrUserName(String searchTerm);

	User findUserByPasswordResetToken(String token);

	User findUserByUserName(String userName);

	ZipCodeGeoData findZipCodeGeoData(String zipCode);

	List<ZipCodeGeoData> findZipCodeGeoDataInRange(double lowLatitude,
			double highLatitude, double lowLongitude, double highLongitude);

	BaseFeeWithAdjustersCalculator loadBaseFeeWithAdjustersCalculator(
			Serializable id);

	Inspection loadInspection(Serializable id);
	
	Payment loadPayment(Serializable id);

	Inspector loadInspector(Serializable id);

	InspectorCompany loadInspectorCompany(Serializable id);

	Invoice loadInvoice(Serializable id);

	InvoiceLineItem findInvoiceLineItemByInspectionId(String inspectionId);

	List<Invoice> findInvoicesForCompanyId(String companyId);

	List<Invoice> findUnpaidInvoicesForCompanyId(String companyId);

	List<Invoice> findPaidInvoicesForCompanyId(String companyId);

	List<PaymentLineItem> findPaymentLineItemsBySource(String sourceId);

	Object findPaymentSource(String paymentSourceId, PaymentSourceType paymentSourceType);
	
	Payment findPaymentByInvoiceNumber(
			String invoiceNumber);

	Payment findCompletedPaymentBySource(String sourceId);
	
	OptionalService loadOptionalService(Serializable id);

	RealEstateAgent loadRealEstateAgent(Serializable id);

	Scheduler loadScheduler(Serializable id);

	User loadUser(Serializable id);

}